﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace DoubleCompletionBar.Example
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            //OpenTaskProgress(int mTaskCount, bool isAutoIncrease, bool isEnableAbort)
            HDEC.Controls.DoubleCompletionBar.OpenTaskProgress(3, true, true);
            HDEC.Controls.DoubleCompletionBar.UpdateTaskProgress("双进度", 0);
            for(int i=0;i<3;i++)
            {
                HDEC.Controls.DoubleCompletionBar.OpenUI();
                HDEC.Controls.DoubleCompletionBar.UpdateUI("子进度", 10);
                Thread.Sleep(1000);
                HDEC.Controls.DoubleCompletionBar.UpdateUI("子进度", 30);
                Thread.Sleep(1000);
                HDEC.Controls.DoubleCompletionBar.UpdateUI("子进度", 70);
                Thread.Sleep(1000);
                HDEC.Controls.DoubleCompletionBar.UpdateUI("子进度", 100);
                Thread.Sleep(1000);
                HDEC.Controls.DoubleCompletionBar.CloseUI();
            }
            HDEC.Controls.DoubleCompletionBar.CloseTaskProgress();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            HDEC.Controls.DoubleCompletionBar.OpenUI();
            HDEC.Controls.DoubleCompletionBar.UpdateUI("子进度", 10);
            Thread.Sleep(1000);
            HDEC.Controls.DoubleCompletionBar.UpdateUI("子进度", 30);
            Thread.Sleep(1000);
            HDEC.Controls.DoubleCompletionBar.UpdateUI("子进度", 70);
            Thread.Sleep(1000);
            HDEC.Controls.DoubleCompletionBar.UpdateUI("子进度", 100);
            Thread.Sleep(1000);
            HDEC.Controls.DoubleCompletionBar.CloseUI();
        }
    }
}
